qtforpythonuimgrwrapper module

class sd.api.qtforpythonuimgrwrapper.QtForPythonUIMgrWrapper(uiMgr)

Bases: object

addActionToExplorerToolbar(explorerID: int, action: PySide2.QtWidgets.QAction) → None

Add an action to an explorer toolbar

Parameters
  • explorerID – Explorer identifier

  • action – action

addToolbarToGraphView(graphViewID: int, toolbar: PySide2.QtWidgets.QToolBar, icon: Optional[PySide2.QtGui.QIcon] = None, tooltip: Optional[str] = None) → None

Add a toolbar to a graph view

Parameters
  • graphViewID – Graph view identifier

  • toolbar – Toolbar to add to the widget

  • toolbar – The toolbar icon

  • tooltip – The toolbar tooltip

static convertSDTextureToQImage(sdTexture: sd.api.sdtexture.SDTexture) → PySide2.QtGui.QImage

Convert a SDTexture into a QImage

Parameters

sdTexture – The texture that will be converted

deleteMenu(objectName: str) → None

Remove a menu from the application menu bar

Parameters

objectName – The internal object name of the menu

findMenuFromObjectName(objectName: str) → Optional[PySide2.QtWidgets.QMenu]

Return an existing menu in the application menu bar

Parameters

objectName – The internal object name of the menu

getCurrentGraph() → Optional[sd.api.sdgraph.SDGraph]

Get the current graph (can be null)

getCurrentGraphSelectedNodes() → Optional[sd.api.sdarray.SDArray[sd.api.sdnode.SDNode][sd.api.sdnode.SDNode]]

Get the selected nodes in the current graph

getCurrentGraphSelectedObjects() → Optional[sd.api.sdarray.SDArray[sd.api.sdgraphobject.SDGraphObject][sd.api.sdgraphobject.SDGraphObject]]

Get the selected graph objects in the current graph

getCurrentGraphSelection(**kwargs)
getCurrentGraphSelectionFromGraphViewID(**kwargs)
getExplorerSelection(explorerID: int) → sd.api.sdarray.SDArray[sd.api.sdapiobject.SDAPIObject][sd.api.sdapiobject.SDAPIObject]

Return the currently selected items in the explorer panel

Parameters

explorerID – Explorer identifier

getGraphFromGraphViewID(graphViewID: int) → Optional[sd.api.sdgraph.SDGraph]

Get the graph from a Graph View ID (can be null)

Parameters

graphViewID – The Graph View ID

getGraphSelectedNodesFromGraphViewID(graphViewID: int) → Optional[sd.api.sdarray.SDArray[sd.api.sdnode.SDNode][sd.api.sdnode.SDNode]]

Get the selected nodes in a graph from a Graph View ID (can be null)

Parameters

graphViewID – The Graph View ID

getGraphSelectedObjectsFromGraphViewID(graphViewID: int) → Optional[sd.api.sdarray.SDArray[sd.api.sdgraphobject.SDGraphObject][sd.api.sdgraphobject.SDGraphObject]]

Get the selected graph objects in the current graph

Parameters

graphViewID – The Graph View ID

getMainWindow() → Optional[PySide2.QtWidgets.QMainWindow]

Get the main window

newDockWidget(identifier: str, title: str) → PySide2.QtWidgets.QWidget

Create a new dock widget

Parameters
  • identifier – Dock internal identifier (must be unique)

  • title – Dock title

newMenu(menuTitle: str, objectName: str) → PySide2.QtWidgets.QMenu

Create a new menu in the application menu bar

Parameters
  • menuTitle – The menu title

  • objectName – The internal object name of the menu

registerExplorerCreatedCallback(callable: Callable[[int], None]) → int

Register a callback to be called when a new explorer is created Returns a callback ID that can be used later to unregister the callback

Parameters

callable – Function to call when a new explorer is created

registerExplorerSelectionChangedCallback(callable: Callable[[int], None]) → int

Register a callback to be called when the explorer selection changed Returns a callback ID that can be used later to unregister the callback

Parameters

callable – Function to call when the explorer selection changed

registerGraphViewCreatedCallback(callable: Callable[[int], None]) → int

Register a callback to be called when a new graph view is created Returns a callback ID that can be used later to unregister the callback

Parameters

callable – Function to call when a new graph view is created

unregisterCallback(callbackID: int) → None

Unregister a callback

Parameters

callbackID – The callback ID of the callback to unregister